package com.manlitech.manlichat.util.convert;

import com.manlitech.manlichat.dto.ChatMessage;
import com.manlitech.manlichat.pojo.nettywebsocket.ChatToOneMessage;

import java.util.Date;

/**
 * @author shensg
 */
public class ChatToOneMessageConvertToChatMessage {

    public static ChatMessage convert(ChatToOneMessage chatToOneMessage){
        ChatMessage chatMessage = new ChatMessage();
        chatMessage.setContent(chatToOneMessage.getContent());
        chatMessage.setCreateTime(new Date());
        chatMessage.setFromId(chatToOneMessage.getFromId());
        chatMessage.setToId(chatToOneMessage.getToId());
        chatMessage.setSee(chatToOneMessage.getSee());
        return chatMessage;
    }
}
